

<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>运动管理</title>
    <meta name="description" content="运动管理">
    <meta name="keywords" content="运动管理">

    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<?php  header("Content-type: text/html; charset=utf-8");

require("conn.php");

 
?>
    <!--下三排原CSS--->
    <link href="main/bootstrap_2.css" rel="stylesheet" type="text/css">
<link href="main/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="main/951a7624ee-v1811.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="main/font-awesome.min.css">
    <link rel="stylesheet" href="static/css/font-awesome.min.css">
    <link rel="stylesheet" href="static/css/ionicons.min.css">
    <link rel="stylesheet" href="static/css/blue.css">
    <link rel="stylesheet" href="static/css/morris.css">
    <link rel="stylesheet" href="static/css/jquery-jvectormap-1.2.2.css">
    <link rel="stylesheet" href="static/css/datepicker3.css">
    <link rel="stylesheet" href="static/css/daterangepicker.css">
    <link rel="stylesheet" href="static/css/bootstrap3-wysihtml5.min.css">
    <link rel="stylesheet" href="static/css/dataTables.bootstrap.css">
    <link rel="stylesheet" href="static/css/jquery.treetable.css">
    <link rel="stylesheet" href="static/css/jquery.treetable.theme.default.css">
    <link rel="stylesheet" href="static/css/bootstrap-colorpicker.min.css">
    <link rel="stylesheet" href="static/css/bootstrap-markdown.min.css">
    <link rel="stylesheet" href="static/css/AdminLTE.css">
    <link rel="stylesheet" href="static/css/_all-skins.min.css">
    <link rel="stylesheet" href="static/css/style.css">
    <link rel="stylesheet" href="static/css/ion.rangeSlider.css">
    <link rel="stylesheet" href="static/css/ion.rangeSlider.skinNice.css">
    <link rel="stylesheet" href="static/css/slider.css">
    <link rel="stylesheet" href="static/css/bootstrap-datetimepicker.css">

    <link rel="shortcut icon" href="../img/ico/favicon.ico" type="image/x-icon"/>
    <!--引入angular-->

    <link rel="stylesheet" href="static/css/pagination.css">


<script src="main/push.js" id="ttzz"></script><script src="main/push(1).js"></script><script src="main/hm.js"></script><script src="main/2d7f05aed0-v1811.js" type="text/javascript"></script>
</head>

<body class="hold-transition skin-purple sidebar-mini" ng-app="tanhaogongManager" ng-controller="userController">


<!-- 内容区域 -->
<div class="box-body">

    <!-- 内容头部 -->
   <div class="ui-portlet">
  <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="#"><i class="fa fa-home"></i>&nbsp;&nbsp;运动管理</a></li>
          <li class="breadcrumb-item active">运动管理</li>
  </ol>
</div>
    <!-- 内容头部 /-->

    <!-- 正文区域 -->

    <!-- .box-body -->
    <!--<div class="box box-primary"> -->
        <div class="box-header with-border">
            <h3 class="box-title">运动列表</h3>
        </div>

        <div class="box-body">

            <!-- 数据表格 -->
            <div class="table-box">

                <!--工具栏-->
                <div class="pull-left">
                    <div class="form-group form-inline">
                    </div>
                </div>
<?php 
$action=@$_GET['action'];


if ($action=="shan") {
$uid =$_GET['pid'];

   $sql22 = "DELETE FROM pin WHERE id = '". $uid."'  ";
   if ($result22= mysql_query($sql22 ,$conn)) {
       echo "<script language='javascript'>alert('删除运动成功！');window.history.back(-1);</script>";
   }
}
  ?> 
                <div class="mb10">
                    <table width="0" border="0" cellspacing="0" cellpadding="0">
                        <form action="?action=lei" id="sform" name="lei" method="get">   
                       
                              <input class="editors-select"  name="title" placeholder="输入学生名">
                       
                        <button type="submit" class="btn btn-default" ng-click="findPage()">查询</button>
                    
                </form>    
            </table>
                </div>

                <!--工具栏/-->

                <div class="messageBox btline2">
                <!--数据列表-->
                <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                    <thead>
                    <tr>

                     
                      <th class="text-center" >活动名</th>
                             <th class="text-center">学生名</th>
                            <th class="text-center">时间</th>
                             <th class="text-center">图片</th>
                            <th class="text-center">时长</th>
                            <th class="text-center">打卡地点</th>
                             <th class="text-center">积分</th>
                            
                            <th class="text-center">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                         
 <?php
                
  $Page_size=10; 
$result=mysql_query('select * from pin '); 
$count = mysql_num_rows($result); 
$page_count = ceil($count/$Page_size); 

$init=1; 
$page_len=7; 
$max_p=$page_count; 
$pages=$page_count; 

$keys=@$_GET['keys'];
//判断当前页码 
if(empty($_GET['page'])||$_GET['page']<0){ 
$page=1; 
}else { 
$page=$_GET['page']; 
} 
$xu=@$_GET['xu'];
$offset=$Page_size*($page-1);
  $bianhao =@$_GET['jibing'];
    $title =@$_GET['title'];
 $sql="select * from pin  where 1=1"; 
if ($bianhao!="") {

  $sql=$sql." and bianhao LIKE '%".$bianhao."%'"; 
}
if ($title!="") {

  $sql=$sql." and username LIKE '%".$title."%'"; 
}


$sql=$sql." order by id desc "; 

$sql=$sql." limit $offset,$Page_size"; 

$result=mysql_query($sql,$conn); 
$i=1;
while ($row=@mysql_fetch_array($result)) {

?> 
                        
                     <tr ng-repeat="company in companyList">
                          <!--<td class="text-center"  ng-bind="company.id"></td>-->
                            <td class="text-center" ng-bind="daizhengzhuti"><?php echo  $row["title"]; ?></td>
                            <td class="text-center" ng-bind="daizhengzhuti"><?php echo  $row["username"]; ?></td>
                            <td class="text-center" ng-bind="daizhengzhuti" width="20%"><?php echo date('Y-m-d H:i:s',$row['kaishi']); ?></td>
                            <td class="text-center" ng-bind="money"><img style="width: 70px;height: 70px;" src="<?php echo  $row["pic"]; ?>"></td>
                            <td class="text-center" ng-bind="money"><?php echo  $row["shichang"]; ?>分钟</td>
                              <td class="text-center" ng-bind="money" width="10%"><?php echo  $row["didian"]; ?></td>
                            <td class="text-center" ng-bind="money"><?php echo  $row["jifen"]; ?></td>
                           
                          
                            <td class="text-center">
                                   
                                    <a href="user_manage.php?action=shan&pid=<?php echo $row["id"];?>" class="btn bg-olive btn-xs">删除运动</a>
                                    
                                    
                                                          </td>
                        </tr>
                         

<?php
                    $i=$i+1;
      }
      ?>                    
                                            </tbody>
                </table>
                 <div class="pages">
                <?php 

$page_len = ($page_len%2)?$page_len:$pagelen+1;//页码个数 
$pageoffset = ($page_len-1)/2;//页码个数左右偏移量 

$key=''; 

$key.="<span>共".$count3."</span>&nbsp;#"; //第几页,共几页 
$key.="<span>$page/$pages</span> "; //第几页,共几页 
if($page!=1){ 
$key.="<a href=\"".$_SERVER['PHP_SELF']."?page=1&keys=".$keys."\">第一页</a> "; //第一页 
$key.="<a href=\"".$_SERVER['PHP_SELF']."?page=".($page-1)."&keys=".$keys."\">上一页</a>"; //上一页 
}else { 
$key.="<a >第一页</a> ";//第一页 
$key.="<a >上一页</a>"; //上一页 
} 
if($pages>$page_len){ 
//如果当前页小于等于左偏移 
if($page<=$pageoffset){ 
$init=1; 
$max_p = $page_len; 
}else{//如果当前页大于左偏移 
//如果当前页码右偏移超出最大分页数 
if($page+$pageoffset>=$pages+1){ 
$init = $pages-$page_len+1; 
}else{ 
//左右偏移都存在时的计算 
$init = $page-$pageoffset; 
$max_p = $page+$pageoffset; 
} 
} 
} 
for($i=$init;$i<=$max_p;$i++){ 
if($i==$page){ 
$key.=' <span>'.$i.'</span>'; 
} else { 
$key.=" <a  href=\"".$_SERVER['PHP_SELF']."?page=".$i."&keys=".$keys."\" class=now>".$i."</a>"; 
} 
} 
if($page!=$pages){ 
$key.=" <a  href=\"".$_SERVER['PHP_SELF']."?page=".($page+1)."&keys=".$keys."\">下一页</a> ";//下一页 
$key.="<a href=\"".$_SERVER['PHP_SELF']."?keys=".$keys."&page={$pages}\">最后一页</a>"; //最后一页 
}else { 
//$key.="下一页 ";//下一页 
//$key.="最后一页"; //最后一页 
} 
$key.=''; 
?>    <?php echo $key?>
                   
    </div>
                <!--数据列表/-->
            </div>
                <!--工具栏-->

                <!-- 数据表格 /-->
                
            </div>
            <!-- /.box-body -->

            <!-- 分页 -->
            <!-- /.box-footer-->


        </div>
    
    <!--</section>-->
    <!-- 正文区域 /-->

<!-- 内容区域 /-->

<!-- 底部导航 -->
<!-- 上传窗口 -->
</div>

</body>

</html>